package com.linkwechat.wecom.service.impl;

import com.linkwechat.wecom.domain.WeworkKfRelation;
import com.linkwechat.wecom.mapper.WeworkKfRelationMapper;
import com.linkwechat.wecom.service.IWeworkKfRelationService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;

import java.util.List;

/**
 * 企微客服客户桥接Service业务层处理
 *
 * @author ruoyi
 * @date 2022-03-11
 */
@Service
public class WeworkKfRelationServiceImpl extends ServiceImpl<WeworkKfRelationMapper, WeworkKfRelation> implements IWeworkKfRelationService {

    @Override
    public List<WeworkKfRelation> queryList(WeworkKfRelation weworkKfRelation) {
        LambdaQueryWrapper<WeworkKfRelation> lqw = Wrappers.lambdaQuery();
        if (weworkKfRelation.getId() != null){
            lqw.eq(WeworkKfRelation::getId , weworkKfRelation.getId());
        }
        if (weworkKfRelation.getServicerId() != null){
            lqw.eq(WeworkKfRelation::getServicerId , weworkKfRelation.getServicerId());
        }
        if (weworkKfRelation.getCustomerId() != null){
            lqw.eq(WeworkKfRelation::getCustomerId , weworkKfRelation.getCustomerId());
        }
        if (weworkKfRelation.getCreateTime() != null){
            lqw.eq(WeworkKfRelation::getCreateTime , weworkKfRelation.getCreateTime());
        }
        if (weworkKfRelation.getUpdateTime() != null){
            lqw.eq(WeworkKfRelation::getUpdateTime , weworkKfRelation.getUpdateTime());
        }

        return this.list(lqw);
    }
}
